﻿<div ng-controller="tenant.views.test.inspecting as vm">
    <div class="row margin-bottom-5">
        <div class="col-xs-12">
            <div class="page-head">
                <div class="page-title">
                    <h1>
                        <b>@L("Test")</b> <small>@L("Test")</small>
                    </h1>
                </div>
            </div>
        </div>
    </div>
  <div class="portlet light">
        <div class="portlet-title text-right">
            <button class="btn btn-primary" ng-click="vm.CreateTest()">
                <i class="glyphicon glyphicon-plus"></i>
                <span>添加</span>
            </button>
            <button class="btn btn-primary" ng-click="vm.UpdateTest()">
                <i class="glyphicon glyphicon-edit"></i>
                <span>修改</span>
            </button>
            <button class="btn btn-primary" ng-click="vm.DeleteTest()">
                <i class="glyphicon glyphicon-trash"></i>
                <span>删除</span>
            </button>
            <button class="btn btn-default" onclick="alert('未完成！');">
                <i class="fa fa-file-excel-o"></i>
                <span>@L("ExportToExcel")</span>
            </button>
        </div>
        <div class="portlet-title" ng-if="vm.permissions.searchAndReset">
            <div class="row" ng-if="vm.filtersAreShown">
                <div ng-repeat="item in vm.searchConditionsData">
                    <div class="col-md-6" ng-if="item.state">
                        <div style="height: 42px;" ng-if="item.type == 'input_text'">
                            <input type="text" class="form-control" ng-model="$parent.conf[$index]" placeholder="{{item.name}}">
                        </div>
                        <div style="height: 42px;" ng-if="item.type == 'input_time'">
                            <b>{{item.name}}：</b>
                            <select ng-model="$parent.conf[$index].operatorValue" k-options="vm.SelectOptions(item.conf[0])" kendo-drop-down-list=""></select>
                            <input ng-model="$parent.conf[$index].timeValue" k-options="vm.TimeOptions(item.conf[1])" kendo-date-time-picker="">
                        </div>
                        <div style="height: 42px;" ng-if="item.type == 'select'">
                            <b>{{item.name}}：</b>
                            <select ng-model="$parent.conf[$index]" k-options="vm.SelectOptions(item.conf)" kendo-drop-down-list=""></select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row text-right" ng-if="vm.filtersAreShown">
                <div class="col-xs-6">
                    <div style="height: 42px;">
                        <button class="btn btn-default" style="display: block;width: 100%;" ng-click="vm.Reset()"><i class="glyphicon glyphicon-repeat"></i>重置</button>
                    </div>
                </div>
                <div class="col-xs-6">
                    <div style="height: 42px;">
                        <button class="btn btn-primary" style="display: block;width: 100%;" ng-click="vm.Search()"><i class="glyphicon glyphicon-search"></i>搜索</button>
                    </div>
                </div>
            </div>
            <div class="row" style="padding: 0px 15px;">
                <button class="btn default" style="display: block;width: 100%;" ng-if="!vm.filtersAreShown" ng-click="vm.filtersAreShown=!vm.filtersAreShown"><i class="fa fa-angle-down"></i>显示搜索功能</button>
                <button class="btn default" style="display: block;width: 100%;" ng-if="vm.filtersAreShown" ng-click="vm.filtersAreShown=!vm.filtersAreShown"><i class="fa fa-angle-up"></i>隐藏搜索功能</button>
            </div>
        </div>
        <div class="portlet-body">
            <div kendo-grid="vm.mainGrid" options="vm.mainGridOptions"></div>
        </div>
    </div>
</div>

